package com.lzx.user.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author lzx
 * @since 2022-11-22
 */
@Getter
@Setter
@TableName("sys_user")
@ApiModel(value = "SysUser对象", description = "")
public class SysUser implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("编号")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("手机号")
    @Excel(name = "手机号", width = 20, needMerge = true, desensitizationRule = "3_4")
    @NotEmpty(message = "手机号不能为空")
    @Pattern(regexp = "^1([3-9])\\d{9}$", message = "手机号格式不正确")
    private String mobile;

    @ApiModelProperty("密码")
    @NotEmpty(message = "密码必须填写")
    private String password;

    @ApiModelProperty("用户名")
    @Excel(name = "用户名")
    private String username;

    @ApiModelProperty("账号状态(0正常 1停用)")
    private String status;

    @ApiModelProperty("创建时间")
    @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createTime;

    @ApiModelProperty("更新时间")
    @Excel(name = "更新时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date updateTime;

    @ApiModelProperty("ip")
    @Excel(name = "ip")
    private String ip;

    @ApiModelProperty("地址")
    @Excel(name = "地址")
    private String address;
}
